Matthias Clasen [Mon, 13 Apr 2020 00:39:03 +0000 (20:39 -0400)]
gtk-demo: Add a gears demo
Matthias Clasen [Mon, 13 Apr 2020 00:13:16 +0000 (20:13 -0400)]
Adwaita: visible focus outline for color swatches
Make the focus outline for color swatches visible
again.
Matthias Clasen [Sun, 12 Apr 2020 22:53:54 +0000 (22:53 +0000)]
Merge branch 'arnaudb/better-substitution' into 'master'
Fix some gtk-builder-tool substitutions.
See merge request GNOME/gtk!1675
Matthias Clasen [Sun, 12 Apr 2020 22:07:20 +0000 (22:07 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
text: Fix placing the cursor on click
See merge request GNOME/gtk!1673
Matthias Clasen [Sun, 12 Apr 2020 19:12:37 +0000 (15:12 -0400)]
text: Be more careful with cached layouts
If we call any functions that may call ensure_layout
themeselves, we risk having the cached layout pulled
out from underneath. Better play it safe and take a
reference.
Matthias Clasen [Sun, 12 Apr 2020 17:33:32 +0000 (13:33 -0400)]
window: Cosmetic cleanup
Use a convenience function to get the current event time.
Matthias Clasen [Sun, 12 Apr 2020 17:32:57 +0000 (13:32 -0400)]
textview: Fix an erroneous unref
This was left behind by accident in
0ee58e9ef41830e.
Arnaud Bonatti [Sun, 12 Apr 2020 19:21:24 +0000 (21:21 +0200)]
Coding style improvements.
Arnaud Bonatti [Sun, 12 Apr 2020 16:41:42 +0000 (18:41 +0200)]
Fix tests for margin-left and margin-right.
Arnaud Bonatti [Sun, 12 Apr 2020 16:40:14 +0000 (18:40 +0200)]
Replace also margin-left and margin-right.
Arnaud Bonatti [Sun, 12 Apr 2020 16:49:11 +0000 (18:49 +0200)]
Fix tests for hexpand and vexpand.
Arnaud Bonatti [Sun, 12 Apr 2020 16:38:13 +0000 (18:38 +0200)]
Fix --3to4 tests for margin substitution.
Arnaud Bonatti [Sun, 12 Apr 2020 15:32:40 +0000 (17:32 +0200)]
Fix a gtk-builder-tool substitution.
The margin-left and margin-right properties have been
removed in favor of margin-start and margin-end ones.
Matthias Clasen [Sun, 12 Apr 2020 16:10:18 +0000 (12:10 -0400)]
wayland: Avoid criticals when unsetting transient parents
Must not check the display when parent is NULL.
Matthias Clasen [Sun, 12 Apr 2020 15:27:56 +0000 (11:27 -0400)]
stylecontext: Respect cursor aspect ratio everywhere
We were using the new cursor aspect ratio setting in
the snapshotting code, but not in gtk_render_insertion_cursor.
Make them both behave the same.
Matthias Clasen [Sun, 12 Apr 2020 14:40:07 +0000 (10:40 -0400)]
reftest: get backtraces
In the hope of making ci-only failures less of a black hole,
add a backtrace to the messsage for criticals.
This could eventually go into GLib (pass backtrace symbols along
as a log field for criticals), but for now this will do.
Emmanuele Bassi [Sun, 12 Apr 2020 13:58:55 +0000 (13:58 +0000)]
Merge branch 'ci-error-report' into 'master'
ci: Count 'ERROR' codes as failures
See merge request GNOME/gtk!1674
Emmanuele Bassi [Sun, 12 Apr 2020 13:28:59 +0000 (14:28 +0100)]
ci: Count 'ERROR' codes as failures
Otherwise they'll be dropped from our reports.
Matthias Clasen [Sun, 12 Apr 2020 13:16:51 +0000 (09:16 -0400)]
text: Fix placing the cursor on click
Commit
c297d45b8a19d84e0 accidentally removed the
check for the right modifier mask, causing us to
always extend the selection.
sicklylife [Sun, 12 Apr 2020 08:53:45 +0000 (08:53 +0000)]
Update Japanese translation
Piotr Drąg [Sun, 12 Apr 2020 08:45:54 +0000 (10:45 +0200)]
Update POTFILES.in
Matthias Clasen [Sun, 12 Apr 2020 02:27:38 +0000 (02:27 +0000)]
Merge branch 'show-uri-async' into 'master'
Redo gtk_show_uri_on_window
See merge request GNOME/gtk!1671
Matthias Clasen [Sun, 12 Apr 2020 01:58:19 +0000 (21:58 -0400)]
gtk: Port all users to the new gtk_show_uri()
We were only handling the error in one place anyway.
Matthias Clasen [Sun, 12 Apr 2020 01:56:32 +0000 (21:56 -0400)]
Redo gtk_show_uri_on_window
Make this a full async function, and add a simple wrapper.
Call gtk_show_uri_full() if you need control over the
results, and use gtk_show_uri() if you are fine with
ignoring any errors.
Matthias Clasen [Sun, 12 Apr 2020 00:24:14 +0000 (00:24 +0000)]
Merge branch 'current-event-apis' into 'master'
Current event apis
See merge request GNOME/gtk!1668
Matthias Clasen [Sat, 11 Apr 2020 19:04:52 +0000 (15:04 -0400)]
Drop gtk_get_current_ apis
We have event controller apis to replace these.
There is one remaining use of gtk_get_current_event_time
in gtkwindow.c, so we can't drop the implementation yet.
Add a section in the migration guide for this.
Matthias Clasen [Sat, 11 Apr 2020 18:54:08 +0000 (14:54 -0400)]
tests: Stop using gtk_get_current_ apis
Replace these by equivalent event controller
apis where needed.
Matthias Clasen [Sat, 11 Apr 2020 18:52:43 +0000 (14:52 -0400)]
gtk: Port widgets away from gtk_get_current_ apis
This commit handles complicated cases where we selections.
We handle this by adding extend and modify parameters to
the ::move-cursor signals, and adjust the bindings
accordingly.
Matthias Clasen [Sat, 11 Apr 2020 18:58:15 +0000 (14:58 -0400)]
gtk: Port widgets away from gtk_get_current_ apis
Use the event controller equivalents where needed.
This commit covers the simple cases.
Matthias Clasen [Sat, 11 Apr 2020 16:40:21 +0000 (12:40 -0400)]
Add gtk_event_controller_get_current_event[_state]
For now these are private, to replace internal uses
of gtk_get_current_event[_state], but we may want to
make them public.
Matthias Clasen [Sat, 11 Apr 2020 17:10:20 +0000 (13:10 -0400)]
gtk: Just use current time for showing urls
We don't really have an event anywhere close in most
cases, and we already pass GDK_CURRENT_TIME in half
the cases anyway.
If we want to be serious about this, we need to pass
the event itself, since future focus-stealing protocols
may not rely on just a timestamp.
Matthias Clasen [Sat, 11 Apr 2020 17:09:45 +0000 (13:09 -0400)]
entrycompletion: Remove an unused field
No point in storing a device that is never used.
Matthias Clasen [Sat, 11 Apr 2020 21:16:11 +0000 (21:16 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
broadway: Fix the build
See merge request GNOME/gtk!1670
Matthias Clasen [Sat, 11 Apr 2020 20:24:05 +0000 (16:24 -0400)]
broadway: Fix the build
We need to depend on gdkenum_h, since we are (indirectly)
including gdkenumtypes.h in the broadway server build.
Matthias Clasen [Sat, 11 Apr 2020 16:47:32 +0000 (16:47 +0000)]
Merge branch 'jjardon/more_licenses' into 'master'
gtk/gtkaboutdialog: Add some more very common licenses:
See merge request GNOME/gtk!1667
Javier Jardón [Sat, 11 Apr 2020 15:49:09 +0000 (16:49 +0100)]
gtk/gtkaboutdialog: Add some more very common licenses:
- BSD 3-Clause "New" or "Revised" license
- Apache License 2.0
- Mozilla Public License 2.0
Emmanuele Bassi [Sat, 11 Apr 2020 15:21:11 +0000 (15:21 +0000)]
Merge branch 'gsk-public-symbols' into 'master'
Install all headers with public symbols
Closes #2607
See merge request GNOME/gtk!1666
Matthias Clasen [Sat, 11 Apr 2020 15:12:22 +0000 (15:12 +0000)]
Merge branch 'action-docs' into 'master'
Action docs
See merge request GNOME/gtk!1665
Emmanuele Bassi [Sat, 11 Apr 2020 14:42:51 +0000 (15:42 +0100)]
Conditionally include the GSK broadway and vulkan symbols
In case GTK is built without these features.
Emmanuele Bassi [Sat, 11 Apr 2020 14:41:47 +0000 (15:41 +0100)]
Revert "Do not install GSK headers for missing backends"
This reverts commit
cd5cded430c37fcb57d0ecc03f8fdf2fdbe12c54.
The headers are public, but the symbols availability is conditional on
the GTK build.
Matthias Clasen [Sat, 11 Apr 2020 03:59:21 +0000 (23:59 -0400)]
Document actions
Matthias Clasen [Sat, 11 Apr 2020 01:13:38 +0000 (21:13 -0400)]
gdk: Small documentation fixes
Matthias Clasen [Sat, 11 Apr 2020 14:06:18 +0000 (10:06 -0400)]
testsuite: Make actions test order-independent
We only want to check that the actions are what we
expect, not that they are registered in a particular
order.
Matthias Clasen [Fri, 10 Apr 2020 18:56:44 +0000 (18:56 +0000)]
Merge branch 'respect-window-cursors' into 'master'
window: Respect widget cursors
See merge request GNOME/gtk!1663
Matthias Clasen [Fri, 10 Apr 2020 18:35:02 +0000 (14:35 -0400)]
window: Respect widget cursors
gtk_widget_set_cursor can be used on a GtkWindow; we
should not blow away the result when temporarily installing
resize cursors.
Matthias Clasen [Fri, 10 Apr 2020 17:36:03 +0000 (17:36 +0000)]
Merge branch 'remove-style-reset' into 'master'
Remove gtk_style_context_reset_widgets
See merge request GNOME/gtk!1662
Matthias Clasen [Fri, 10 Apr 2020 16:45:28 +0000 (12:45 -0400)]
Remove gtk_style_context_reset_widgets
This should never be necessary to call from the outside.
Whenever we fail to update styles properly, it is a bug.
Matthias Clasen [Fri, 10 Apr 2020 16:43:05 +0000 (16:43 +0000)]
Merge branch 'reduce-style-context-use' into 'master'
Use gtk_widget_add/remove_css_class more
See merge request GNOME/gtk!1661
Matthias Clasen [Fri, 10 Apr 2020 16:08:16 +0000 (12:08 -0400)]
Use gtk_widget_add/remove_css_class more
Replace most uses of gtk_style_context_add/remove_class
by the new APIs. The only remaining uses of the old API
are in save/restore situations.
Matthias Clasen [Fri, 10 Apr 2020 13:27:07 +0000 (13:27 +0000)]
Merge branch 'fix-accel-length' into 'master'
accelgroup: Fix an invalid write
Closes #2602
See merge request GNOME/gtk!1660
Matthias Clasen [Fri, 10 Apr 2020 12:24:03 +0000 (08:24 -0400)]
accelgroup: Fix an invalid write
This was lost by accident in
d110fddbce14d13c.
Fixes: #2602
Piotr Drąg [Fri, 10 Apr 2020 11:56:58 +0000 (13:56 +0200)]
Update POTFILES.in and POTFILES.skip
Matthias Clasen [Fri, 10 Apr 2020 04:17:37 +0000 (04:17 +0000)]
Merge branch 'fix-radiobuttons' into 'master'
radiobutton: Fix selection on focus-in
Closes #2326
See merge request GNOME/gtk!1658
Matthias Clasen [Fri, 10 Apr 2020 04:17:15 +0000 (04:17 +0000)]
Merge branch 'popover-initial-focus' into 'master'
Popover initial focus
See merge request GNOME/gtk!1657
Matthias Clasen [Fri, 10 Apr 2020 02:38:30 +0000 (22:38 -0400)]
radiobutton: Fix selection on focus-in
We need to unselect the previously selected button
to preserve radioness.
Fixes: #2326
Matthias Clasen [Fri, 10 Apr 2020 02:22:28 +0000 (22:22 -0400)]
modelbutton: Catch focus-in more carefully
We need to unset the propagation limit on the focus
controller, else we miss the focus-in when the focus
enters the popover upon initial popup, when it comes
from the parent button.
Matthias Clasen [Fri, 10 Apr 2020 01:41:02 +0000 (21:41 -0400)]
popovermenu: Remove debug spew
Matthias Clasen [Fri, 10 Apr 2020 01:34:49 +0000 (01:34 +0000)]
Merge branch 'label-double-focus' into 'master'
Avoid double focus in labels
Closes #135
See merge request GNOME/gtk!1656
Matthias Clasen [Fri, 10 Apr 2020 01:21:25 +0000 (01:21 +0000)]
Merge branch 'scale-button-double-focus' into 'master'
scalebutton: Don't derive from GtkButton
See merge request GNOME/gtk!1655
Matthias Clasen [Fri, 10 Apr 2020 01:18:01 +0000 (21:18 -0400)]
Adwaita: Don't render focus around labels with links
This avoids the 'double outline' problem for labels
with links.
Fixes: #135
Matthias Clasen [Fri, 10 Apr 2020 01:15:30 +0000 (21:15 -0400)]
label: Improve link styling
Add a .link style class on labels that contain links,
so we can avoid the focus outline around the label
when individual links are focused, and use the link
node when rendering the focus on links.
Matthias Clasen [Fri, 10 Apr 2020 00:24:23 +0000 (20:24 -0400)]
scalebutton: Don't derive from GtkButton
Make GtkScaleButton a widget that has a toggle button
as a child, just like all the other button widgets now.
The immediate benefit of this arrangement is to avoid
the "double focus" problem when we pop up the popup.
Update accessible, demos and tests to match.
Matthias Clasen [Fri, 10 Apr 2020 00:26:53 +0000 (00:26 +0000)]
Merge branch 'wip/matthiasc/can-focus' into 'master'
Implement new focus behavior
See merge request GNOME/gtk!1652
Matthias Clasen [Thu, 9 Apr 2020 21:29:48 +0000 (17:29 -0400)]
Mention focus changes in the migration guide
Matthias Clasen [Thu, 9 Apr 2020 21:17:58 +0000 (17:17 -0400)]
Small documentation tweaks
Update the docs for GtkWidget:can-focus and :focus-on-click.
Matthias Clasen [Thu, 9 Apr 2020 16:03:23 +0000 (12:03 -0400)]
Move focus to the parent if a popover is dismissed
This is better than just dropping focus altogether,
and is expected behavior in most cases.
Matthias Clasen [Thu, 9 Apr 2020 04:41:30 +0000 (00:41 -0400)]
Update a11y test results
Matthias Clasen [Thu, 9 Apr 2020 21:50:02 +0000 (17:50 -0400)]
a11y: Fix focusable state
The :can-focus property is no longer very useful to
give an indication of what is focusable, since it is
TRUE for almost all widgets now. Patch things up
to by looking at known widget types.
Matthias Clasen [Thu, 9 Apr 2020 04:08:48 +0000 (00:08 -0400)]
Fix the tools tests to not set can-focus
Matthias Clasen [Thu, 9 Apr 2020 03:22:13 +0000 (23:22 -0400)]
Disable focus-chain test that depends on the environment
The color editor shows a color picker button only if it
finds a suitable implementation, which it does not in ci.
So disable the focus-chain test for page 3.
Matthias Clasen [Wed, 8 Apr 2020 12:08:46 +0000 (08:08 -0400)]
color editor: Make the sample non-focusable again
This is one of the situations, where can-focus can still
be used to tweak focus behavior of leaf widgets. Color
swatches are focusable by default to allow selecting colors
with the keyboard. But when used as color samples, they
should not take focus.
Matthias Clasen [Wed, 8 Apr 2020 12:01:58 +0000 (08:01 -0400)]
Remove focusable-container tests
Like the previous commit, these tests were relying
on setting :can-focus to make an unsuspecting container
focusable, which does not work anymore.
Matthias Clasen [Wed, 8 Apr 2020 11:59:23 +0000 (07:59 -0400)]
Remove the focus test
This test was expecting to make existing widgets like
GtkBox focusable by setting :can-focus. That just doesn't
work anymore.
The focus chain testing that is done here is already
better covered by test-focus-chain, so lets just remove this.
Matthias Clasen [Thu, 9 Apr 2020 02:13:06 +0000 (22:13 -0400)]
Fix up focus chain result
The notebook grab_focus change in the previous commit made
backwards tabbing work as expected, and thereby changed the
output of one of the focus-chain tests.
Matthias Clasen [Wed, 8 Apr 2020 11:43:28 +0000 (07:43 -0400)]
Reinstate expected focus behavior
After the :can-focus change in the previous commit, widgets
need to set suitable focus and grab_focus implementations
to implement the desired focus behavior.
This commit does that for all widgets.
Matthias Clasen [Wed, 8 Apr 2020 11:40:48 +0000 (07:40 -0400)]
Change the default value of GtkWidget:can-focus
Make widgets can-focus by default, and change the semantics
of can-focus to be recursive . If it is set to FALSE, focus
can not enter the widget or its descendents at all anymore.
This commit temporarily breaks focus behavior of widgets
that did not expect to receive focus.
Matthias Clasen [Wed, 8 Apr 2020 11:42:27 +0000 (07:42 -0400)]
widget: Add common focus vfunc implementations
Privately export a number of implementations for the focus
and grab_focus vfuncs that cover many common cases.
Matthias Clasen [Wed, 8 Apr 2020 11:34:38 +0000 (07:34 -0400)]
gizmo: Allow passing changing focus behavior
We need this in popovers. Maybe it could be done better
by defining one-off custom widgets.
Matthias Clasen [Fri, 3 Apr 2020 00:51:31 +0000 (20:51 -0400)]
widget: Make the :has-focus property readonly
The only place where this should be set is when making
a widget the focus-widget of a window. We still keep
the property around in readonly form, since there are
a few places where we rely on property notification
for it.
Matthias Clasen [Fri, 3 Apr 2020 00:50:35 +0000 (20:50 -0400)]
testsuite: Stop setting :has-focus
This is not necessary, whenever we want to set the initial
focus in a ui file, we can set GtkWindow:focus-widget.
Matthias Clasen [Fri, 3 Apr 2020 00:30:17 +0000 (20:30 -0400)]
widget: Drop the :is-focus property
This property doesn't carry any new information compared
to GtkWindow:focus-widget. We still keep the gtk_widget_is_focus
getter, as a convenient shortcut.
Matthias Clasen [Mon, 30 Mar 2020 02:11:38 +0000 (22:11 -0400)]
reftests: Stop using can-focus
Matthias Clasen [Mon, 30 Mar 2020 01:50:31 +0000 (21:50 -0400)]
a11y tests: Stop using can-focus
Matthias Clasen [Mon, 30 Mar 2020 01:14:23 +0000 (21:14 -0400)]
testsuite: Stop using can-focus
Matthias Clasen [Mon, 30 Mar 2020 01:05:38 +0000 (21:05 -0400)]
inspector: Drop more uses of can-focus
Matthias Clasen [Mon, 30 Mar 2020 00:34:49 +0000 (20:34 -0400)]
inspector: Remove can-focus from ui files
Matthias Clasen [Mon, 30 Mar 2020 00:09:33 +0000 (20:09 -0400)]
Stop setting can-focus in ui files
None of these settings are necessary.
Matthias Clasen [Sun, 29 Mar 2020 19:26:56 +0000 (15:26 -0400)]
window: Make set_focus equal to grab_focus
Make gtk_window_set_focus call gtk_widget_grab_focus internally.
This means that set_focus can now end up putting the focus on
a child of the passed-in widget, and makes the focus-widget
property work for setting initial focus to (the child of) an
entry in a ui file.
Matthias Clasen [Sun, 29 Mar 2020 19:19:23 +0000 (15:19 -0400)]
root: Reorganize focus handling
Make :focus-widget a GtkWindow property and add vfuncs
to the GtkRoot interface instead of the property.
Matthias Clasen [Sat, 4 Apr 2020 05:25:31 +0000 (01:25 -0400)]
Add more focus chain tests
Test page 2 and 3 of widget-factory as well, and try other directions.
Matthias Clasen [Wed, 8 Apr 2020 21:32:48 +0000 (17:32 -0400)]
Fix running focus-chain tests in ci
The widget-factory ui files require geettings
(for the color chooser), so set GSETTINGS_SCHEMA_DIR.
Matthias Clasen [Wed, 8 Apr 2020 11:48:35 +0000 (07:48 -0400)]
notbook: Fix a bug in focus handling
After the header widget was introduced, focus would get
stuck in a loop between actions and tabs.
This could be seen in the notebook on page 3 of
widget-factory.
Matthias Clasen [Thu, 9 Apr 2020 18:11:18 +0000 (14:11 -0400)]
coloreditor: Draw a focus around the color plane
Not doing it was just an oversight.
Matthias Clasen [Thu, 9 Apr 2020 18:10:23 +0000 (14:10 -0400)]
colorplane: Set a css name
Every widget should have one.
Matthias Clasen [Wed, 8 Apr 2020 23:59:02 +0000 (23:59 +0000)]
Merge branch 'wip/xdg-popup-move' into 'master'
Wayland popup moving
See merge request GNOME/gtk!1017
Jonas Ådahl [Tue, 17 Mar 2020 14:30:25 +0000 (15:30 +0100)]
wayland: Move transient-for field to GdkWaylandToplevel
A toplevel will only ever be transient-for to another toplevel, and only
a toplevel will ever be transient-for, so move the field into the
GdkWaylandToplevel, and make it a pointer to another GdkWaylandToplevel.
Jonas Ådahl [Tue, 17 Mar 2020 14:28:14 +0000 (15:28 +0100)]
wayland: Add surface to toplevel list only if toplevel
It was using another check (has parent) to do this, but now we have a
much more obvious way of creating surfaces, so we can use the type
directly.
Jonas Ådahl [Tue, 17 Mar 2020 14:26:58 +0000 (15:26 +0100)]
wayland: Remove own pointer to the popup parent
It's there already as the GdkSurface::parent, no need to duplicate.
Jonas Ådahl [Tue, 17 Mar 2020 14:23:57 +0000 (15:23 +0100)]
wayland: Move toplevel/popup/drag surface definitions higher up
We them up there, so that code higher up compared to where they are
defined now can make use of them. Also add a few macros for type
checking and casting.
Jonas Ådahl [Sun, 16 Feb 2020 19:09:42 +0000 (20:09 +0100)]
wayland: Move popups with xdg_popup.reposition
The third version of xdg-shell introduces support for explicit popup
repositioning. If available, make use of this to implement popup
repositioning.
Note that this does *NOT* include atomic parent-child state
synchronization. For that,
https://gitlab.freedesktop.org/wayland/wayland-protocols/issues/13 will
be needed.
This currently uses my own fork of wayland-protocols which adds meson
support, so that we can use it as a subproject. Eventually when
wayland-protocols' meson support lands upstream, we should change it to
point there.
Silence some meson warnings while at it to make CI happy.
This also bumps the glib requirement, since g_warning_once() is used.